//
//  DB_TableViewModel.h
//  RacMVVM
//
//  Created by 崔博 on 2018/11/27.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "DB_BaseViewModel.h"

@interface DB_TableViewModel : DB_BaseViewModel

// data source of table view
@property (nonatomic, strong) NSArray *dataSource;

/// section titles to display in section index view.
@property (nonatomic, copy) NSArray *sectionIndexTitles;

@property (nonatomic, assign) NSUInteger page;
@property (nonatomic, assign) NSUInteger perPage;

@property (nonatomic, assign) BOOL shouldPullToRefresh;
@property (nonatomic, assign) BOOL shouldInfiniteScrolling;

@property (nonatomic, strong) RACCommand *didSelectCommand;
@property (nonatomic, strong, readonly) RACCommand *requestRemoteDataCommand;

- (BOOL (^)(NSError *error))requestRemoteDataErrorsFilter;

- (NSUInteger)offsetForPage:(NSUInteger)page;

- (RACSignal *)requestRemoteDataSignalWithPage:(NSUInteger)page;
@end
